package com.tbb.app.common.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;


/**
 * 业务异常
 *
 * @author LiuSenLin
 * @date 2020/2/29
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class BusinessException extends RuntimeException {
    private BaseErrorCode errorCode;

    private String message;

    private Object data;

    public BusinessException(String message) {
        this.message = message;
        this.errorCode = CommonCode.C00001;
    }

    public BusinessException(BaseErrorCode errorCode) {
        this.errorCode = errorCode;
        this.message = errorCode.getMessage();
    }

}
